1 /* JJT: 0.2.2 */
2
3 package mobisnap.mobile_trx;
4
5 /***
6 * Implements short-circuit OR
7 */
8 public class ASTBasicDataTypeDeclaration extends mobisnap.mobile_trx.SimpleNode
9 {
10 public static final int BDT_CHAR = 101;
11 public static final int BDT_VARCHAR = 102;
12 public static final int BDT_VARCHAR2 = 103;
13 public static final int BDT_INTEGER = 104;
14 public static final int BDT_NUMBER = 105;
15 public static final int BDT_NATURAL = 106;
16 public static final int BDT_REAL = 107;
17 public static final int BDT_FLOAT = 108;
18 public static final int BDT_DATE = 109;
19 public static final int BDT_BINARY_INTEGER = 110;
20 public static final int BDT_BOOLEAN = 111;
21 public static final int BDT_COUNTER = 112;
22
23 public int type;
24 public int nl, nr;
25
26 public ASTBasicDataTypeDeclaration(int id) {
27 super(id);
28 }
29
30 public ASTBasicDataTypeDeclaration( MobisnapSQL p, int i) {
31 super( p, i);
32 id = i;
33 }
34
35 /*** Accept the visitor. **/
36 public Object jjtAccept(MobisnapSQLVisitor visitor, Object data) {
37 return visitor.visit(this, data);
38 }
39
40 /***
41 * Returns a variable that is an instance of the defined type
42 */
43 public MSQLTVariable getInstance( boolean constant, boolean notnull)
44 throws Exception {
45 switch( type) {
46 case BDT_CHAR:
47 return new MSQLTChar( constant, notnull, nl);
48 case BDT_VARCHAR:
49 return new MSQLTVarChar( constant, notnull, nl);
50 case BDT_VARCHAR2:
51 return new MSQLTVarChar2( constant, notnull, nl);
52 case BDT_INTEGER:
53 return new MSQLTInteger( constant, notnull, nl, nr);
54 case BDT_NUMBER:
55 return new MSQLTNumber( constant, notnull, nl, nr);
56 case BDT_REAL:
57 return new MSQLTReal( constant, notnull, nl, nr);
58 case BDT_FLOAT:
59 return new MSQLTFloat( constant, notnull, nl);
60 case BDT_DATE:
61 return new MSQLTDate( constant, notnull);
62 case BDT_BINARY_INTEGER:
63 return new MSQLTBinInt( constant, notnull);
64 case BDT_BOOLEAN:
65 return new MSQLTBoolean( constant, notnull);
66 case BDT_COUNTER:
67 return new MSQLTInteger( constant, notnull, nl, nr);
68 default:
69 throw new mobisnap.MobisnapException( "Basic data type declaration internal error 00");
70 }
71 }
72
73 }
This page was automatically generated by Maven